# -*- coding: utf-8 -*-
#企业证书重复

import json

def getCompanyCertRepeatList(request):
    #1数据
    request.cursor_33.execute(request.formatSql('''
        select company,zzmc 
        from yibiao.yb_biz_company_aptitude 
        group by company,zzmc 
        having count(*) >1
        limit ${start},${rows}
    '''))
    rows = request.cursor_33.fetchall() 
    #2页码
    request.cursor_33.execute(request.formatSql('''
        select count(*) as total from (
            select company,zzmc ,count(*) 
            from yibiao.yb_biz_company_aptitude 
            group by company,zzmc 
            having count(*) >1
        ) as a
    '''))
    total = request.cursor_33.fetchone()['total']
    return json.dumps({'rows':rows,'total':total}, ensure_ascii=False)




